<%@include file="top.jsp"%>
<jsp:useBean id="user" class="mvc.User" scope="session" />
<%
// Get data from user bean
String username = user.getUsername();
// No username = no user in session = not logged in
if(username.equals(""))
out.println("You have to log in to see this page!<br><a href=\"/mvcjsp/login.jsp\">To Login Page</a>");
else{
	out.println("Logged in as " + username + "<br><a href=\"/servlet/mvc.Servl?state=logout\">Logout</a>");
%>
<center>
<table width="560" border="0">
	<tr>
      <td><h3>Upload Photo</h3><hr style="border:dashed #676767; border-width:1px 0 0 0; height:1;"></td>
    </tr>
</table>
<table width="560" border="0">
	<tr>
      <td>
		<FORM name="loginform" method="post" action="/servlet/mvc.Servl?state=upload" enctype="multipart/form-data">
		<input type="file" name="myimage"><br>	
		<INPUT type="submit" name="search" value="Upload"></FORM>
		</td>
	</tr>
</table>
<%if(request.getAttribute("errorMessage")!=null)
out.println(request.getAttribute("errorMessage"));%>
</center>
<%}%>
<%@include file="bottom.jsp"%>

